﻿Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Windows.Forms
Imports org.codegen.win.controls

Class frmCRViewer


    Private Sub crViewer_ReportRefresh(ByVal source As Object, _
                                       ByVal e As CrystalDecisions.Windows.Forms.ViewerEventArgs) Handles crViewer.ReportRefresh

        'Don't  handle refresh event on refresh button click
        e.Handled = True

        'Manually refresh 
        CType(crViewer.ReportSource, ReportClass).Refresh()

    End Sub

    Private Sub frmCRViewer_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        'the hourglass is set ON in CRReportViewer class, method ShowReportFromType
        winUtils.HourglassOff()
    End Sub

    Private Sub frmCRViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.crViewer.Enabled = False
        ' the above is as per http://scn.sap.com/thread/1935979
    End Sub

    Private Sub frmCRViewer_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        Me.crViewer.Enabled = True
        ' the above is as per http://scn.sap.com/thread/1935979
    End Sub
End Class
